package com.example.myapplication

import android.R
import android.os.Bundle
import android.view.View
import android.widget.ArrayAdapter
import android.widget.Spinner
import androidx.appcompat.app.AppCompatActivity


 public class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.demo2_main)
        val sp = findViewById<View>(R.id.spinner) as Spinner
        sp.prompt = "请选择支付方式"
        val adapter =
            ArrayAdapter.createFromResource(this, R.array.mode, R.layout.simple_spinner_item)
        adapter.setDropDownViewResource(R.layout.simple_dropdown_item_1line)
    }
}